package com.kinyx.framework.crawler;

import com.kinyx.framework.bean.GetArgs;
import com.kinyx.framework.bean.KCrawlerInfo;
import com.kinyx.framework.file.KPathUtils;

public class KCrawler_Tester_0_Super {

	String stockCode = "300527";

	String URL = String.format("http://basic.10jqka.com.cn/%s/company.html", this.stockCode);
	String CHARSET = "GBK";
	String filePath = KPathUtils.target() + String.format("/%s.HTML", this.stockCode);

	public Thread toFile(final boolean thread) {
		System.out.println("start -> thread[" + thread + "]");
		final Thread t = KCrawler.crawl(null, KCrawlerInfo.builder()//
				.requestArgs(//
						new GetArgs(this.URL, this.CHARSET)//
								.userAgent("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36")//
				)//
				.filePath(this.filePath)//
				.fileCharset(this.CHARSET)//
				.build(), thread);
		System.out.println("end -> thread[" + thread + "]");
		return t;
	}

}
